from game import *

import math

def init(game):

    start = StaticBox((8.0, 14.0, 8.0))
    start.set_position((0.0, -7.0, 0.0))
    game.add_object(start)

    r1 = MovingPlatform(100000, (4.0, 0.3, 4.0))
    r1.set_position((10.0, 0.0, -8.0))
    r1.set_texture_name("p2")
    r1.set_linear_vel((-1.0, 0.0, 0.0))
    r1.set_angular_vel((0.0, 0.5, 0.0))
    game.add_timer("r1", 20.0, 0.0, r1.reverse)
    game.add_object(r1)
    
    r2 = MovingPlatform(100000, (4.0, 0.3, 4.0))
    r2.set_position((-10.0, 0.0, -16.0))
    r2.set_texture_name("p2")
    r2.set_linear_vel((1.0, 0.0, 0.0))
    r2.set_angular_vel((0.0, 0.5, 0.0))
    game.add_timer("r2", 20.0, 0.0, r2.reverse)
    game.add_object(r2)
    
    r3 = MovingPlatform(100000, (4.0, 0.3, 4.0))
    r3.set_position((10.0, 0.0, -24.0))
    r3.set_texture_name("p2")
    r3.set_linear_vel((-1.0, 0.0, 0.0))
    r3.set_angular_vel((0.0, 0.5, 0.0))
    game.add_timer("r3", 20.0, 0.0, r3.reverse)
    game.add_object(r3)

    p1 = StaticBox((8.0, 14.0, 8.0))
    p1.set_position((0.0, -7.0, -32.0))
    game.add_object(p1)

    p2 = StaticBox((1.5, 20.0, 100.0))
    p2.set_position((0.0, -10.0, -86.0))
    game.add_object(p2)

    freqs = numpy.arange(0.0, 1.0, 0.01)
    posx = (-0.8, 0.8)
    posy = numpy.arange(30.0, 40.0, 0.01)
    posz = numpy.arange(-130.0, -40.0, 0.01)
    sizes = numpy.arange(0.2, 2.0, 0.01)
    dens = numpy.arange(1000, 50000, 1.0)
    texs = ["ball"]
    s1 = BallGenerator("s1", freqs, (posx, posy, posz), sizes, dens, texs)

    
    p3 = StaticBox((20.0, 20.0, 1.5))
    p3.set_position((10.75, -10.0, -135.25))
    game.add_object(p3)
    
    p4 = StaticBox((1.5, 20.0, 150.0))
    p4.set_position((20, -10.0, -211))
    game.add_object(p4)
    
    freqs = numpy.arange(0.0, 1.0, 0.01)
    posx = (19.2, 20.8)
    posy = numpy.arange(30.0, 40.0, 0.01)
    posz = numpy.arange(-260, -130, 0.01)
    sizes = numpy.arange(0.2, 2.0, 0.01)
    dens = numpy.arange(1000, 50000, 1.0)
    texs = ["ball"]
    s2 = BallGenerator("s2", freqs, (posx, posy, posz), sizes, dens, texs)

    #game.set_start_pos((20, 5.0, -270.0))

    r4 = Platform(99999999999999, (5.0, 5.0, 40.0))
    r4.set_position((24.0, 1.0, -310))
    r4.set_angles((20.0, -15.0, 0.0))
    r4.set_angular_vel((0.0, 0.0, 0.2))
    r4.set_texture_name("swirl")
    game.add_object(r4)
    
    freqs = numpy.arange(0.0, 2.0, 0.01)
    posx = numpy.arange(25.0, 35.0, 0.01)
    posy = numpy.arange(40.0, 45.0, 0.01)
    posz = numpy.arange(-340, -320, 0.01)
    sizes = numpy.arange(0.2, 2.0, 0.01)
    dens = numpy.arange(1000, 50000, 1.0)
    texs = ["ball"]
    s3 = BallGenerator("s3", freqs, (posx, posy, posz), sizes, dens, texs)

 
    r5 = Platform(999999999999999, (5.0, 5.0, 40.0))
    r5.set_position((24.0, 1.0, -350))
    r5.set_angles((-20.0, 15.0, 0.0))
    r5.set_angular_vel((0.0, 0.0, 0.2))
    r5.set_texture_name("swirl")
    game.add_object(r5)

    p5 = StaticBox((16.0, 14.0, 16.0))
    p5.set_position((12.0, -7.0, -380.0))
    game.add_object(p5)

    #game.set_start_pos((12.0, 2.0, -380.0))

    r6 = MovingPlatform(10000, (10.0, 10.0, 12.0))
    r6.set_position((12.0, -8.0, -400.0))
    r6.set_texture_name("p2")
    r6.set_linear_vel((0.0, 0.0, -1.0))
    r6.set_angular_vel((0.0, 0.0, 0.2))
    game.add_timer("r6", 64.0, 0.0, r6.reverse)
    game.add_object(r6)
    
    p6 = StaticBox((16.0, 14.0, 16.0))
    p6.set_position((12.0, -12.0, -480.0))
    game.add_object(p6)
    
    #game.set_start_pos((12.0, 2.0, -480.0))

    m1 = MovingPlatform(10000, (3.0, 0.2, 4.0))
    m1.set_position((0.0, -4.0, -480.0))
    m1.set_texture_name("p2")
    m1.set_linear_vel((0.0, -1.0, 0.0))
    game.add_timer("m1", 24.0, 0.0, m1.reverse)
    game.add_object(m1)

    goal = StaticBox((5.0, 0.5, 5.0))
    goal.set_position((6.0, -30.0, -480.0))
    goal.set_texture_name("goal")
    game.add_object(goal)
